import request from '@/utils/request'
import { getHost, getHeaderType } from '@/utils/host'

export function getPageLeaveWord(data) {
  return request({
    method: 'post',
    url: '/leaveWord/getPageLeaveWord',
    baseURL: getHost(),
    data: data,
    headers: getHeaderType()
  })
}

export function getLeaveWordById(id) {
  return request({
    method: 'get',
    url: '/leaveWord/getLeaveWordById',
    baseURL: getHost(),
    params: { id: id },
    headers: getHeaderType()
  })
}

export function delLeaveWord(id) {
  return request({
    method: 'post',
    url: '/leaveWord/delLeaveWord',
    baseURL: getHost(),
    params: { id: id },
    headers: getHeaderType()
  })
}

export function updateStatus(id, status) {
  return request({
    method: 'post',
    url: '/leaveWord/updateStatus',
    baseURL: getHost(),
    params: { id: id, status: status },
    headers: getHeaderType()
  })
}

export function saveAnswer(data) {
  return request({
    method: 'post',
    url: '/answer/saveAnswer',
    baseURL: getHost(),
    data: data,
    headers: getHeaderType()
  })
}

export function loadAnswerList(id) {
  return request({
    method: 'post',
    url: '/answer/loadAnswerList',
    baseURL: getHost(),
    params: { id: id },
    headers: getHeaderType()
  })
}

export function delById(id) {
  return request({
    method: 'post',
    url: '/answer/delById',
    baseURL: getHost(),
    params: { id: id },
    headers: getHeaderType()
  })
}
